package sctu.edu.java.year2016.team04.baiyunfei.day20160526.chapter6_3;

/**
 * 将今天的信息格式化后输出，再将日期以年-月-日的形式输出
 * Created by DE on 2016/5/26.
 */
import java.util.Date;

public class DateAndTime {
    public static void main(String[] args) {


        Date today = new Date();
        String d = String.format("%tc", today);//全部的日期和时间信息
        String a = String.format("%tY", today);//年份
        String b = String.format("%tm", today);//月份
        String c = String.format("%tj", today);//一年中第几天
        String e = String.format("%tA", today);//星期几
        String f = String.format("%tF", today);//组合格式：年-月-日

        System.out.println("now is " + d);
        System.out.println("now is" + a+"年" + b +"月"+ e);
        System.out.println("第 " + c+"天");
        System.out.println(f);
    }
}
